package net.lab1024.sa.common.config;

import com.jd.open.api.sdk.DefaultJdClient;
import com.jd.open.api.sdk.JdClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@Data
public class JdUnionConfig {

    @Value("${jd-union.server-url}")
    String serverUrl;

    @Value("${jd-union.app-key}")
    String appKey;

    @Value("${jd-union.app-secret}")
    String appSecret;

    @Value("${jd-union.owner-union-id}")
    String ownerUnionId;

    @Value("${jd-union.site-id}")
    String siteId;

    @Bean
    public JdClient jdClient(){

        return new DefaultJdClient(serverUrl,"",appKey,appSecret);

    }


}
